/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package nodeLevelMetaModel.impl;

import java.util.Collection;

import nodeLevelMetaModel.BaseStationRole;
import nodeLevelMetaModel.NodeLevelMetaModelPackage;
import nodeLevelMetaModel.OperationalTask;
import nodeLevelMetaModel.ReceivingTask;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.eclipse.emf.ecore.util.EObjectResolvingEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Base Station Role</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link nodeLevelMetaModel.impl.BaseStationRoleImpl#getName5 <em>Name5</em>}</li>
 *   <li>{@link nodeLevelMetaModel.impl.BaseStationRoleImpl#getName6 <em>Name6</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class BaseStationRoleImpl extends RoleImpl implements BaseStationRole {
	/**
	 * The cached value of the '{@link #getName5() <em>Name5</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName5()
	 * @generated
	 * @ordered
	 */
	protected EList<ReceivingTask> name5;

	/**
	 * The cached value of the '{@link #getName6() <em>Name6</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName6()
	 * @generated
	 * @ordered
	 */
	protected OperationalTask name6;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected BaseStationRoleImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return NodeLevelMetaModelPackage.Literals.BASE_STATION_ROLE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<ReceivingTask> getName5() {
		if (name5 == null) {
			name5 = new EObjectResolvingEList<ReceivingTask>(ReceivingTask.class, this, NodeLevelMetaModelPackage.BASE_STATION_ROLE__NAME5);
		}
		return name5;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public OperationalTask getName6() {
		if (name6 != null && name6.eIsProxy()) {
			InternalEObject oldName6 = (InternalEObject)name6;
			name6 = (OperationalTask)eResolveProxy(oldName6);
			if (name6 != oldName6) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, NodeLevelMetaModelPackage.BASE_STATION_ROLE__NAME6, oldName6, name6));
			}
		}
		return name6;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public OperationalTask basicGetName6() {
		return name6;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setName6(OperationalTask newName6) {
		OperationalTask oldName6 = name6;
		name6 = newName6;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, NodeLevelMetaModelPackage.BASE_STATION_ROLE__NAME6, oldName6, name6));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case NodeLevelMetaModelPackage.BASE_STATION_ROLE__NAME5:
				return getName5();
			case NodeLevelMetaModelPackage.BASE_STATION_ROLE__NAME6:
				if (resolve) return getName6();
				return basicGetName6();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case NodeLevelMetaModelPackage.BASE_STATION_ROLE__NAME5:
				getName5().clear();
				getName5().addAll((Collection<? extends ReceivingTask>)newValue);
				return;
			case NodeLevelMetaModelPackage.BASE_STATION_ROLE__NAME6:
				setName6((OperationalTask)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case NodeLevelMetaModelPackage.BASE_STATION_ROLE__NAME5:
				getName5().clear();
				return;
			case NodeLevelMetaModelPackage.BASE_STATION_ROLE__NAME6:
				setName6((OperationalTask)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case NodeLevelMetaModelPackage.BASE_STATION_ROLE__NAME5:
				return name5 != null && !name5.isEmpty();
			case NodeLevelMetaModelPackage.BASE_STATION_ROLE__NAME6:
				return name6 != null;
		}
		return super.eIsSet(featureID);
	}

} //BaseStationRoleImpl
